#include<stdio.h>
int main()
{
	int a,b,c;
	scanf("%d %d",&a,&b);
	int h=a/100;
	int m=a%100;
	c=h*60+m+b;
	h=c/60;
	m=c%60;
	printf("%d",h*100+m);
}
